import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}
export function updatePassword(data) {
  return request({
    url: '/user/updatePassword',
    method: 'put',
    data
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'delete'
  })
}

export function getCurrentUserInfo() {
  return request({
    url: '/user/getCurrentUser',
    method: 'get'
    // params: {}
  })
}

export function updateUserInfo(data) {
  return request({
    url: '/user/updateUser',
    method: 'put',
    data
  })
}
// 用户管理
export function getUserList(data) {
  return request({
    url: '/user/getUserList',
    method: 'get',
    params: data
  })
}
export function createUser(data) {
  return request({
    url: '/user/createUser',
    method: 'post',
    data
  })
}
export function updateUser(data) {
  return request({
    url: '/user/updateUser',
    method: 'put',
    data
  })
}
export function delUser(id) {
  return request({
    url: '/user/delUser/' + id,
    method: 'delete'
  })
}
export function resetPassword(id) {
  return request({
    url: '/user/resetPassword/' + id,
    method: 'put'
  })
}
